<!--
  * 时间：2024/12/2
  * 作者：刘岩
  * 描述：区域客流排行
-->
<template>
  <div class="area-flow-sort">
    <div
      v-for="(item, index) in data"
      :key="index"
      class="sort-box"
    >
      <div class="index">{{ index + 1 }}</div>
      <div class="sort-container">
        <div class="name">
          <span>{{ item.groupName }}</span>
          <span>{{ item.peopleNumber }}</span>
        </div>
        <div class="sort-bar">
          <span class="entity-bar" :style="{'width': item.peopleNumber / data[0].peopleNumber * 100 + '%'}"></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'areaFlowSort',
  props: {
    // 数据
    data: {
      type: Array,
      default: () => {
        return [];
      }
    }
  },
  data() {
    return {
      list: []
    }
  }
}
</script>

<style scoped lang="scss">
.area-flow-sort {
  flex: 1;
  overflow-y: auto;
  .sort-box {
    display: flex;
    align-items: center;
    padding: 5px 0;
    .index {
      width: 30px;
      height: 30px;
      font-size: 16px;
      background: url("../../../assets/large/sort-bg.png") no-repeat;
      background-size: cover;
      line-height: 30px;
      text-align: center;
      margin-right: 15px;
      color: #ffffff;
    }
    .sort-container {
      width: 100%;
      .name {
        font-size: 14px;
        color: #ffffff;
        margin-bottom: 5px;
        display: flex;
        justify-content: space-between;
        padding-right: 10px;
      }
      .sort-bar {
        width: calc(100% - 10px);
        height: 14px;
        background: #192849;
        .entity-bar {
          display: block;
          height: 100%;
          background: linear-gradient(270deg, #47dafe, #234d98);
          border-bottom-right-radius: 10px;
          border-top-right-radius: 10px;
        }
      }
    }
  }
}
</style>
